package com.zts.modules.sys.entity.model;

import com.zts.base.entity.EntityModel;
import com.zts.modules.sys.entity.Group;
import com.zts.util.BeanUtil;
import io.swagger.annotations.ApiModelProperty;
import org.springframework.beans.BeanUtils;

/**
 * Created by lily on 2017/6/7.
 */
public class GroupModel extends EntityModel<Group> {
    @ApiModelProperty(value = "组标识")
    private Long id;
    @ApiModelProperty(value = "组名称")
    private String groupName;
    @ApiModelProperty(value = "组类型")
    private String type;
    @ApiModelProperty(value = "父id")
    private Long parentId;
    @ApiModelProperty(value = "组状态")
    private String status;
    private int sortNum;

    public String getGroupName() {
        return groupName;
    }

    public void setGroupName(String groupName) {
        this.groupName = groupName;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public Long getParentId() {
        return parentId;
    }

    public void setParentId(Long parentId) {
        this.parentId = parentId;
    }

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    public int getSortNum() {
        return sortNum;
    }

    public void setSortNum(int sortNum) {
        this.sortNum = sortNum;
    }

    @Override
    public Group transEntity() {
        Group group = new Group();
        String[] emptyProperties = BeanUtil.getNullPropertyNames(this);
        BeanUtils.copyProperties(this, group, emptyProperties);
        return group;
    }

    @Override
    public Group transEntity(Group entity) {
        String[] emptyProperties = BeanUtil.getNullPropertyNames(this);
        BeanUtils.copyProperties(this, entity, emptyProperties);
        return entity;
    }
}
